//
//  MyCollectionViewCell.m
//  ToYourHeartNews
//
//  Created by XJing on 16/1/17.
//  Copyright © 2016年 www.lanou3g.com 蓝鸥. All rights reserved.
//

#import "MyCollectionViewCell.h"

@implementation MyCollectionViewCell
- (void)dealloc
{
    [_img release];
    [_lable release];
    [super dealloc];
}
//初始化
-(instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        //图片
        self.img = [[UIImageView alloc]init];
        _img.backgroundColor = [UIColor yellowColor];
        [self.contentView addSubview:_img];
        [_img release];
        
        
        //lable
        self.lable = [[UILabel alloc]init];
       // _lable.backgroundColor = [UIColor purpleColor];
        [self.contentView addSubview:_lable];
        [_lable release];
    }
    return self;
}
//布局
-(void)layoutSubviews
{
    [super layoutSubviews];
    _img.frame = CGRectMake(0, 0, self.contentView.frame.size.width - 10, self.contentView.frame.size.height - 10);
    self.img.layer.cornerRadius = _img.frame.size.width / 2;
    self.img.clipsToBounds = YES;
    _lable.frame = CGRectMake(_img.frame.origin.x + _img.frame.size.width / 3, _img.frame.origin.y + _img.frame.size.height, 40, 20);
    _lable.font = [UIFont systemFontOfSize:15];
    _lable.tintColor = [UIColor grayColor];
}
@end
